Chapter 13: Unified Configuration Reference
The langchain-security-extension framework and its companion applications support deterministic, zero-trust configuration via declarative Python decorators, property configuration files (config.properties), and standard environment variables.
Every property defined in config.properties can be overridden at deployment time by declaring an uppercase environment variable where dots are replaced by underscores (for example, security.pdp.mode is overridden by SECURITY_PDP_MODE).
1. Policy Decision Point (PDP) & Authorization Engine
These settings govern whether policy evaluation is performed in-process by the embedded rule engine or delegated to an external service like Open Policy Agent (OPA), as well as remote circuit breaker thresholds.
| Property Key / Env Var | Type & Values | Default Value | Description & Operational Impact |
|---|---|---|---|
security.pdp.modeSECURITY_PDP_MODE |
StringEMBEDDED | OPA |
EMBEDDED |
Selects the primary authorization engine. EMBEDDED evaluates role hierarchies and numeric clearance locally in Python memory with sub-millisecond latency. OPA delegates evaluations to an external REST endpoint. |
security.pdp.opa.urlSECURITY_PDP_OPA_URL |
String (URL) | http://localhost:8181/v1/data/langchain/security/allow |
The target REST endpoint for Open Policy Agent (or Cedar sidecar) decision queries when security.pdp.mode=OPA. |
security.pdp.opa.timeoutSECURITY_PDP_OPA_TIMEOUT |
Float (Seconds) | 0.05 (50ms) |
HTTP client timeout for remote PDP evaluations. Outages or latency spikes exceeding this threshold immediately record an evaluation failure. |
security.pdp.circuitbreaker.thresholdSECURITY_PDP_CIRCUITBREAKER_THRESHOLD |
Integer | 1 (assistant)5 (library core) |
Number of consecutive network timeouts or 5xx errors from the remote PDP that trip the circuit breaker into OPEN state. |
security.pdp.circuitbreaker.recoverySECURITY_PDP_CIRCUITBREAKER_RECOVERY |
Float (Seconds) | 30.0 |
Cooldown window before an OPEN circuit breaker transitions to HALF_OPEN to probe remote PDP recovery. During OPEN, requests fail closed deterministically. |
2. Two-Tier Decision Cache (L1 & L2)
The library features a two-tier decision caching architecture to avoid redundant evaluations and eliminate token-stage delays.
| Property Key / Env Var | Type & Values | Default Value | Description & Operational Impact |
|---|---|---|---|
security.cache.l1.enabledSECURITY_CACHE_L1_ENABLED |
Booleantrue | false |
true |
Enables Tier 1 invocation-scoped memoization. Decisions are stored directly inside LangChain's RunnableConfig["configurable"]["sec:decision_cache"], providing zero-lock, thread-agnostic cache hits across all sub-agents and tools within a single request. |
security.cache.l2.enabledSECURITY_CACHE_L2_ENABLED |
Booleantrue | false |
true |
Enables Tier 2 cross-request LRU decision caching across multiple invocations for identical caller roles and resources. |
security.cache.l2.ttlSECURITY_CACHE_L2_TTL |
Float (Seconds) | 60.0 (assistant)300.0 (library core) |
Time-to-live for Tier 2 cached verdicts. Automatically invalidated early if caller roles or clearance are revoked via OPACacheInvalidationHandler. |
security.cache.l2.maxEntriesSECURITY_CACHE_L2_MAXENTRIES |
Integer | 1000 (assistant)4096 (library core) |
Maximum capacity of the Tier 2 LRU cache. When exceeded, least-recently-used authorization verdicts are pruned. |
3. Tool Interception, Anti-Looping & Abuse Throttling
Settings governing pre-execution tool parameter validation, retry budgets for soft model feedback, and cross-turn brute-force abuse protection.
| Property Key / Env Var | Type & Values | Default Value | Description & Operational Impact |
|---|---|---|---|
security.retry.maxViolationsSECURITY_RETRY_MAXVIOLATIONS |
Integer | 3 (assistant)2 (library core) |
Maximum number of consecutive policy denials permitted for informational tools before escalating to a HARD_ABORT. Shuts down runaway LLM tool retry loops. |
security.abuse.windowSecondsSECURITY_ABUSE_WINDOWSECONDS |
Float (Seconds) | 60.0 |
Sliding temporal window in seconds used to track denied tool executions per subject across turns. |
security.abuse.maxDenialsSECURITY_ABUSE_MAXDENIALS |
Integer | 3 |
Denial cap within security.abuse.windowSeconds. When reached, triggers a critical POLICY_BRUTE_FORCE_SCANNING threat alert in SIEM and throttles execution. |
4. Data Loss Prevention (DLP) & In-Flight PII Redaction
Governs automated regex masking of sensitive parameters, Luhn-valid credit card numbers, Indian Aadhaar/PAN IDs, passwords, and bearer tokens.
| Property Key / Env Var | Type & Values | Default Value | Description & Operational Impact |
|---|---|---|---|
security.pii.redaction.scopeSECURITY_PII_REDACTION_SCOPE |
Stringaudit_only | full_in_flight | disabled |
audit_only |
audit_only: Scrubs PII and credentials exclusively before payloads are emitted to SIEM and log aggregators.full_in_flight: Irreversibly scrubs PII across prompts, tool arguments, tool outputs, RAG chunks, and audit logs.disabled: Disables automated PII scrubbing.
|
DEFAULT_REDACTION_TOKEN |
String | [REDACTED] |
Replacement token substituted in place of detected secrets, credit cards, or PII. |
5. Knowledge Ingestion & Vector Retrieval (RAG) Security
Controls metadata labeling, cryptographic HMAC verification, and oversampling retrieval behavior for knowledge bases.
| Property Key / Env Var | Type & Values | Default Value | Description & Operational Impact |
|---|---|---|---|
security.ingestion.modeSECURITY_INGESTION_MODE |
StringSTRICT_FAIL_CLOSED | EVERYTHING_CLASSIFIED | EVERYTHING_PUBLIC |
STRICT_FAIL_CLOSED |
STRICT_FAIL_CLOSED: Rejects and rolls back document batches if any chunk lacks mandatory sec:* metadata envelopes.EVERYTHING_CLASSIFIED: Tags unlabelled chunks as sec:quarantined = true with RESTRICTED classification.EVERYTHING_PUBLIC: Defaults unlabelled chunks to PUBLIC (clearance 0).
|
security.hmac.secretSECURITY_HMAC_SECRET |
String | enterprise-hmac-secret-key |
Shared secret key used to compute and verify the HMAC-SHA256 signature in sec:envelope_hash. Prevents direct database tampering of chunk clearance. |
security.retriever.oversamplingSECURITY_RETRIEVER_OVERSAMPLING |
Float | 3.0 |
Predictive multiplier ($K_{fetch} = K_{target} \times factor$) applied to vector search candidate windows to guarantee Top-K documents remain after post-retrieval clearance pruning. |
DEFAULT_MAX_FETCH_CAP |
Integer | 50 |
Absolute upper bound on candidate chunks fetched from the vector store during oversampling. |
6. Multi-Tenancy & Default Identity Attributes
Fallback identity parameters applied when perimeter tokens lack explicit tenant or organizational claims.
| Property Key / Env Var | Type & Values | Default Value | Description & Operational Impact |
|---|---|---|---|
security.default.tenantSECURITY_DEFAULT_TENANT |
String | CORP_MAIN (assistant)DEFAULT_TENANT (core) |
Tenant partition assigned when no tenant_id claim is present in caller credentials. |
security.default.departmentSECURITY_DEFAULT_DEPARTMENT |
String | IT_OPS (assistant)GENERAL (core) |
Department partition assigned when no department attribute is supplied in caller identity. |
jwt.secretJWT_SECRET |
String | secret-key |
HMAC secret key used by perimeter authentication filters to sign and verify Bearer JWT tokens. |
7. Audit Telemetry & SIEM Streaming
Parameters governing non-blocking asynchronous log shipping to enterprise SIEM platforms (Splunk, Elastic, Datadog).
| Property Key / Env Var | Type & Values | Default Value | Description & Operational Impact |
|---|---|---|---|
DEFAULT_RING_BUFFER_CAPACITY |
Integer | 16384 |
Capacity of the in-memory ring buffer for audit events. Background publisher threads drain this buffer asynchronously without adding latency to agent turns. |
DEFAULT_PAYLOAD_MAX_CHARS |
Integer | 2048 |
Truncation threshold for raw event payload dumps inside emitted audit logs to prevent SIEM message exhaustion. |
splunk.hec.urlSPLUNK_HEC_URL |
String (URL) | Optional (Empty) | Splunk HTTP Event Collector (HEC) endpoint URL for direct streaming of RFC 5424 / OCSF audit events. |
splunk.tokenSPLUNK_TOKEN |
String | Optional (Empty) | Authentication bearer token for Splunk HEC ingestion. |
8. Demonstrator Server & Model Configuration
These settings configure the host server and language model integrations in langchain-enterprise-incident-assistant.
| Property Key / Env Var | Type & Values | Default Value | Description & Operational Impact |
|---|---|---|---|
server.host / SERVER_HOST |
String | 0.0.0.0 |
Host binding interface for the embedded FastAPI server. |
server.port / SERVER_PORT |
Integer | 8080 |
Listening TCP port for the embedded assistant server. |
chroma.url / CHROMA_URL |
String (URL) | http://localhost:8000 |
Target ChromaDB vector database instance URL. |
chroma.collection / CHROMA_COLLECTION |
String | it_runbooks |
ChromaDB collection storing classified IT incident runbooks. |
model1.baseUrlMODEL1_BASEURL |
String (URL) | http://localhost:11434 |
Base URL of LLM provider for Model 1 (Triage Agent). Supports Ollama, OpenAI, Gemini, or Claude. |
model1.modelclassMODEL1_MODELCLASS |
Stringollama | openai |
ollama |
ChatModel adapter protocol for Model 1 (Triage Agent). Use openai for OpenAI, Gemini Flash (OpenAI compatibility mode), or Claude gateways. |
model1.modelnameMODEL1_MODELNAME |
String | llama3.2:3b |
Target model identifier for Model 1 (Triage Agent). |
model1.apikeyMODEL1_APIKEY |
String | Optional (Empty) | API key for commercial providers for Model 1. |
model1.timeoutMODEL1_TIMEOUT |
String | 300s |
HTTP client timeout for Model 1 inferences. |
model2.baseUrlMODEL2_BASEURL |
String (URL) | http://localhost:11434 |
Base URL of LLM provider for Model 2 (Remediation Agent). Can match model1 or point to an independent model backend. |
model2.modelclassMODEL2_MODELCLASS |
Stringollama | openai |
ollama |
ChatModel adapter protocol for Model 2 (Remediation Agent). |
model2.modelnameMODEL2_MODELNAME |
String | llama3.2:3b |
Target model identifier for Model 2 (Remediation Agent). |
model2.apikeyMODEL2_APIKEY |
String | Optional (Empty) | API key for commercial providers for Model 2. |
model2.timeoutMODEL2_TIMEOUT |
String | 300s |
HTTP client timeout for Model 2 inferences. |
Summary & Related Guides
- Chapter 3: Setting Up Your Authorization Engine — Detailed OPA vs Embedded setup.
- Chapter 8: Defending Against Agent Looping — Fine-tuning retry budgets and abuse windows.
- Chapter 10: Connecting to Enterprise SIEM — Ring buffer and telemetry forwarder architecture.
- Chapter 12: Troubleshooting & Diagnostics — Diagnosing misconfigurations and failure modes.